/*
 Navicat Premium Data Transfer

 Source Server         : 腾讯云-广州-22年11月
 Source Server Type    : MySQL
 Source Server Version : 50734
 Source Host           : 134.175.60.227:3306
 Source Schema         : php_mall

 Target Server Type    : MySQL
 Target Server Version : 50734
 File Encoding         : 65001

 Date: 24/09/2021 09:02:11
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for img
-- ----------------------------
DROP TABLE IF EXISTS `img`;
CREATE TABLE `img` (
                       `id` int(11) NOT NULL AUTO_INCREMENT,
                       `img_url` varchar(2083) COLLATE utf8_unicode_ci NOT NULL,
                       PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of img
-- ----------------------------
BEGIN;
INSERT INTO `img` VALUES (1, '/static/userimg/1.jpg');
INSERT INTO `img` VALUES (2, '/static/userimg/2.jpg');
INSERT INTO `img` VALUES (3, '/static/userimg/3.jpg');
COMMIT;

-- ----------------------------
-- Table structure for product
-- ----------------------------
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
                           `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键（自增）	商品在数据库中的编码',
                           `cid` int(10) DEFAULT NULL COMMENT '分类	关联product_cates表ID',
                           `title` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '商品名称',
                           `pro_no` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '商品编码	随机生成的一个字符串',
                           `keywords` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '关键字	方便用户搜索',
                           `img` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '商品主图	建议采用路径存储url',
                           `price` decimal(10,2) DEFAULT NULL COMMENT '商品最低价	为了吸引用户进入浏览 给出最低配置甚至配件价格',
                           `desc` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '商品描述	商品简介，广告词等',
                           `pv` int(10) DEFAULT NULL COMMENT '点击量	分析流量，统计数据',
                           `status` tinyint(1) DEFAULT NULL COMMENT '产品状态	状态：-1 已删除 0 下架 1 上架',
                           `add_time` int(10) DEFAULT NULL COMMENT '发布时间	添加时间',
                           PRIMARY KEY (`id`),
                           UNIQUE KEY `product_id_uindex` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of product
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for product_brand
-- ----------------------------
DROP TABLE IF EXISTS `product_brand`;
CREATE TABLE `product_brand` (
                                 `id` int(10) DEFAULT NULL,
                                 `brand_name` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
                                 `logo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
                                 `pid` int(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of product_brand
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for product_cates
-- ----------------------------
DROP TABLE IF EXISTS `product_cates`;
CREATE TABLE `product_cates` (
                                 `id` int(10) NOT NULL COMMENT '主键（自增）',
                                 `pid` int(10) DEFAULT NULL COMMENT '上级分类id	0为最高分类 1 为二级分类 数字越大 分类越后',
                                 `title` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '标签标题	分类名称',
                                 `status` tinyint(1) DEFAULT NULL COMMENT '产品状态	状态： 0 正常 1 禁用',
                                 `add_time` int(10) DEFAULT NULL COMMENT '添加时间',
                                 PRIMARY KEY (`id`),
                                 UNIQUE KEY `product_cates_id_uindex` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of product_cates
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for product_details
-- ----------------------------
DROP TABLE IF EXISTS `product_details`;
CREATE TABLE `product_details` (
                                   `id` int(11) NOT NULL,
                                   `product_id` int(11) DEFAULT NULL,
                                   `detail` varchar(5000) DEFAULT NULL,
                                   `add_time` datetime DEFAULT NULL,
                                   PRIMARY KEY (`id`),
                                   UNIQUE KEY `product_details_id_uindex` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of product_details
-- ----------------------------
BEGIN;
COMMIT;

-- ----------------------------
-- Table structure for sys_admin
-- ----------------------------
DROP TABLE IF EXISTS `sys_admin`;
CREATE TABLE `sys_admin` (
                             `id` int(10) NOT NULL AUTO_INCREMENT,
                             `username` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
                             `pwd` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
                             `tel` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
                             `email` varchar(20) COLLATE utf8_unicode_ci DEFAULT NULL,
                             `add_time` int(50) DEFAULT NULL,
                             `role` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
                             `status` tinyint(4) DEFAULT NULL,
                             PRIMARY KEY (`id`),
                             UNIQUE KEY `user_admin_id_uindex` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- ----------------------------
-- Records of sys_admin
-- ----------------------------
BEGIN;
INSERT INTO `sys_admin` VALUES (1, 'admin', '123456', '123456789', '66666@qq.com', NULL, '超管', 0);
INSERT INTO `sys_admin` VALUES (2, 'Xadmin', '123456', '123456789', NULL, NULL, NULL, NULL);
COMMIT;

-- ----------------------------
-- Table structure for user_address
-- ----------------------------
DROP TABLE IF EXISTS `user_address`;
CREATE TABLE `user_address` (
                                `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键（自增）',
                                `tel` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '手机号',
                                `address` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '详细地址',
                                `province` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '省',
                                `city` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '市',
                                `area` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '区',
                                PRIMARY KEY (`id`),
                                UNIQUE KEY `member_address_id_uindex` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='用户收货地址表';

-- ----------------------------
-- Records of user_address
-- ----------------------------
BEGIN;
INSERT INTO `user_address` VALUES (1, '1233211234', '广东东莞松山湖理工学院', '广东', '东莞', '松山湖');
COMMIT;

-- ----------------------------
-- Table structure for user_info
-- ----------------------------
DROP TABLE IF EXISTS `user_info`;
CREATE TABLE `user_info` (
                             `id` int(10) NOT NULL AUTO_INCREMENT COMMENT '主键（自增）',
                             `tel` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '手机号	 可以用来登录',
                             `password` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '密码',
                             `nick_name` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT ' 昵称',
                             `user_name` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '用户名	可以用来登录',
                             `input_time` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '注册时间',
                             `img_url` varchar(2083) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '头像图片url',
                             `address_id` int(10) DEFAULT NULL COMMENT '默认收货地址	关联menber_address表id',
                             `update_time` varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT '登录时间	每次登录更新',
                             PRIMARY KEY (`id`),
                             UNIQUE KEY `member_info_id_uindex` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='用户表';

-- ----------------------------
-- Records of user_info
-- ----------------------------
BEGIN;
INSERT INTO `user_info` VALUES (1, '1233211234', '123456', 'zz', 'zly', NULL, 'https://picsum.photos/id/610/300/300', 1, NULL);
INSERT INTO `user_info` VALUES (4, '0987667890', '123456', 'ahhhh', 'zzy', NULL, 'https://picsum.photos/id/613/300/300', NULL, NULL);
INSERT INTO `user_info` VALUES (5, '123456789', '123456', 'emmmm', 'szz', NULL, 'https://picsum.photos/id/616/300/300', NULL, NULL);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
